package com.example.mapper;

import com.example.models.student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.codehaus.jettison.json.JSONArray;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Mapper
public interface EmpMapper {
    @RequestMapping
    public List<student> StudentList(student stu);
    @RequestMapping
    public  List<student> getUser(Integer id,String phone);
    @Insert("insert into students(phone,password,user_id,name) values (#{stu.getPhone()},#{stu.getPassword()},#{stu.getUserId()},#{stu.getName()})")
    public void insertUser(student stu);
    @RequestMapping
    public void DeleteStudents(List str);
    @RequestMapping
    public void creatStudent(student stu);
    @RequestMapping
    public void updateStudent(student stu);
    @Update("update students set password = #{password} where user_id = #{userId} and phone = #{phone};")
    public Integer ForgetPassword(student stu);
}
